package models

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Username string `gorm:"varchar(30)" json:"username"`
	Password string `gorm:"varchar(30)" json:"password"`
}

// 角色表
type Role struct {
	gorm.Model
	RoleName string `gorm:"varchar(30)"`
}

// 用户与角色关系表
type UserRole struct {
	gorm.Model
	Uid int `gorm:"int"`
	Rid int `gorm:"int"`
}

// 权限表
type Node struct {
	gorm.Model
	NodeName string `gorm:"varchar(30)" json:"nodeName"`
}

// 角色与权限关系表
type NodeRole struct {
	gorm.Model
	Rid int `gorm:"int"`
	Nid int `gorm:"int"`
}

// 仓库表
type House struct {
	gorm.Model
	HouseCode int    `gorm:"int" json:"houseCode"`
	HouseName string `gorm:"varchar(30)" json:"houseName"`
	Author    string `gorm:"varchar(30)" json:"author"`
}

// 仓库订单表
type HouseOrder struct {
	gorm.Model
	OrderNun   int `gorm:"int" json:"orderNun"`
	OrderPrice int `gorm:"int" json:"orderPrice"`
	Hid        int `gorm:"int"`
}

type HouseList struct {
	OrderId    int    `gorm:"int"`
	HouseCode  int    `gorm:"int" json:"houseCode"`
	HouseName  string `gorm:"varchar(30)" json:"houseName"`
	Author     string `gorm:"varchar(30)" json:"author"`
	OrderNun   int    `gorm:"int" json:"orderNun"`
	OrderPrice int    `gorm:"int" json:"orderPrice"`
}
